home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_12
/
9n12116b
< prev
next >
Wrap
Text File
|
1991-10-19
|
491b
|
29 lines
/* LISTING 8 - OBJ.C */
/* implement a 'constructor' to do the
circle object startup */
#include <stdio.h>
#include "obj.h"
#define SETCOLOR 0
#define GETCOLOR 1
main()
{
int col;
/* create a new circle c1 to work with */
CIRCLE c1;
/* call the constructor function for c1 */
constructor(&c1, 14);
/* use GETCOLOR message to get color */
col = (*(c1.pcact->pcact[GETCOLOR]))(&c1);
printf("c1 is color %d\n", col);
}